import { message } from 'ant-design-vue';
//显示错误消息
const showErrors = (businessData: any) => {
    //如果是单条消息就显示单条消息
    if (businessData.errMsg) {
        message.error(businessData.errMsg);
    } else {
        //如果是多条消息就显示多条消息,1秒显示一条
        const errMsgList = businessData.errMsgList as string[];
        const errLen = errMsgList.length;
        message.error(errMsgList[0]);
        let n = 1;
        const messageInterval = setInterval(function () {
            if (n < errLen) {
                message.error(errMsgList[n]);
                n++;
            } else {
                //
                clearInterval(messageInterval);
            }
            //
        }, 1000);
    }
}
export default showErrors;